<#assign menu="system">
<#assign submenu="update_admin">
<#include "/system/head.ftl">
<style type="text/css">

</style>
<!--main content start-->
	<section id="main-content">
		<section class="wrapper">
		<!-- page start-->
			<div class="row">
			<div class="col-lg-12">
			<section class="panel">
				<header class="panel-heading">
 					修改菜单
				</header>
				<div class="panel-body">
					<form id="update_menu_form" method="post" class="form-horizontal" autocomplete="off" action="${basePath}/admin/menu/update.json">
					<fieldset>
					<input type="hidden" name="menuEntity.id" id="id" value="<#if menuEntity??>${menuEntity.id}</#if>"/> 
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">菜单名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="menuEntity.menuName" value="<#if menuEntity??>${menuEntity.menuName}</#if>"
                            	placeholder="菜单名称" id="menuName" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">菜单URL</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="menuEntity.menuUrl" value="<#if menuEntity??><#if menuEntity.menuUrl??>${menuEntity.menuUrl}</#if></#if>"
                            	placeholder="菜单URL" id="menuUrl" >
                        </div>
                    </div>
                    <div class="form-group">
                    	<label class="col-sm-2 col-sm-2 control-label"></label>
                        <button class="btn btn-danger" type="submit">修改</button>
                    </div>
                   </fieldset>
				</form>
				</div>
			</section>
		</div>
		</div>
<!-- page end-->
		</section>
	</section>
 <!--main content end-->
<script type="text/javascript">
	$(function() {
		$('#update_menu_form').ajaxForm({
			dataType : 'json',
			success : function(data) {
				if (data.result) {
					bootbox.alert("保存成功，将刷新页面", function() {
						window.location.reload();
					});
				}else{
					showErrors($('#update_menu_form'),data.errors);
				}
			},
			error:function(data,textstatus){
		        bootbox.alert({  
		            buttons: {  
		               ok: {  
		                    label: '关闭'
		               }  
		            },
		            message: data.responseText,
		            title: '<@spring.message "system.errorTip"/>',  
		        });
	        }
		});
	});	
</script>
<#include "/system/foot.ftl">
